<%--
  Created by IntelliJ IDEA.
  User: 吴超
  Date: 2022/4/11
  Time: 16:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
 request.setCharacterEncoding("utf-8");
 String name=(String)request.getParameter("name");
 out.print(name+"<br/>"+session.getId());
 if(name.equals("cc")){
     session.setAttribute("user",name);
     session.setMaxInactiveInterval(60);
     Cookie ck=new Cookie("user",name);
     ck.setMaxAge(40);
     response.addCookie(ck);
     request.getRequestDispatcher("sucess.jsp").forward(request,response);
 }else{

 }

%>
</body>
</html>
